#pragma once

//#include "RFLanDeviceNet.h"
#include "RFComDeviceNet.h"
#include "include\RF60xDevice.h"
#include "RFdeviceDefsNet.h"

using namespace RFDevice;

namespace RFDeviceNet
{
	public ref class RF60xDeviceNet  : public RFComDeviceNet
	{
	public:
		static RF60xDeviceNet^ CreateRF60xDevice();
		~RF60xDeviceNet();

		bool	OpenPort(String^ port_Name, DWORD speed);
		void	BindNetworkAddress(BYTE address);
		bool	GetTimeouts(DWORD% readIntervalTimeout, DWORD% readTotalTimeoutMultiplier, 
							DWORD% readTotalTimeoutConstant, DWORD% writeTotalTimeoutMultiplier, 
							DWORD% writeTotalTimeoutConstant);
		bool	SetTimeouts(DWORD readIntervalTimeout, DWORD readTotalTimeoutMultiplier, 
							DWORD readTotalTimeoutConstant, DWORD writeTotalTimeoutMultiplier, 
							DWORD writeTotalTimeoutConstant);
		bool	HelloCmd(BYTE address, _RF60x_HELLO_ANSWER_Net^% helloAnswer);
		bool	HelloCmd();
		bool	GetStreamMeasures(_RF60x_STREAM_VALUE_Net^% streamValues, DWORD measuresCount, 
								  DWORD% readedMeasuresCount, DWORD% brokenPacketsCount);
		float	GetSingleMeasure();
		bool	EnableSensor(bool enable);
		bool	EnableAnalogOut(bool enable);
		bool	SetSampleAveraging(BYTE value);

		bool	SetAverageModeByQuantity();
		bool	SetAverageModeByTime();
		bool	SetCANModeByRequest();
		bool	SetCANModeByClk();
		bool	SetLogicOutModeToRangeOverflow();
		bool	SetLogicOutModeToMutualSynchronization();
		bool	SetLogicOutModeToResZeroing();
		bool	SetLogicOutModeToLaserPower();
		bool	SetAnalogOutModeToFrameMode();
		
	protected:
		RF60xDeviceNet();
		RF60xDeviceNet(RFDevice::RF60xDevice* device);
		RF60xDevice* _rf60xDevice;
	};
}

